package com.gitee.srurl.core.util;

import com.google.common.hash.Hashing;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.nio.charset.StandardCharsets;

/**
 * @author zxw
 * @date 2023/5/3 11:04
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public abstract class MurmurHashUtil {

    public static String murmur128(String v) {
        return Hashing.murmur3_128().hashString(v, StandardCharsets.UTF_8).toString();
    }

    public static String murmur32(String v) {
        return Hashing.murmur3_32_fixed().hashString(v, StandardCharsets.UTF_8).toString();
    }
}
